﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserControlBuyProduct.ascx.cs" Inherits="Supermarket.Web.UserControls.UserControlBuyProduct" %>

<asp:HiddenField ID="hfId" runat="server" />
<table>
    <tr>
        <td>
            <span>Продукт:</span>
        </td>
        <td>
            <asp:Label ID="LabelProductName" Text='<%# Eval("ProductName") %>' runat="server" />
        </td>
    </tr>
    <tr>
        <td>
            <span>Цена:</span>
        </td>
        <td>
            <asp:Label ID="LabelProductPrice" runat="server" /><span> лв.</span>
        </td>
    </tr>
    <tr>
        <td>
            <span>Количество:</span>
        </td>
        <td>
            <asp:TextBox ID="TextBoxQuantity" Width="50" runat="server" />
            <asp:Label ID="LabelMeasureCode" runat="server" />            
        </td>
    </tr>
    <tr>
        <td>
            <asp:Button ID="ButtonBuy" runat="server" Text="Купи" 
                onclick="ButtonBuy_Click" />
        </td>
        <td>
            <asp:Button ID="ButtonCancel" runat="server" Text="Отказ" 
                onclick="ButtonCancel_Click" CausesValidation="False" />
        </td>
    </tr>    
</table>

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                            ErrorMessage="Въведете цяло или реално число с десетична запетая."
                                            Text="Въведете цяло или реално число с десетична запетая."
                                            CssClass="failureNotification"
                                            ControlToValidate="TextBoxQuantity"
                                            ValidationExpression="(\d+(,|\.\d{1,3})?){1}"></asp:RegularExpressionValidator>
      
      <br />      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ErrorMessage="Въведете количество."
                                        Text="Въведете количество."
                                        CssClass="failureNotification"
                                        ControlToValidate="TextBoxQuantity"></asp:RequiredFieldValidator>

